action muxer: cosmetics
authorMatthias Clasen <mclasen@redhat.com>
Sat, 15 Jun 2019 22:04:19 +0000 (22:04 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 16 Jun 2019 01:40:17 +0000 (21:40 -0400)
gtk/gtkactionmuxer.c

index d2e58b5dd4fa52e1ae98e573343e96797506a8e8..292606250d109e70582d8800490be97f8bf8d834 100644 (file)
@@ -102,13 +102,10 @@ typedef struct
 } Group;
 
 static void
-gtk_action_muxer_append_group_actions (gpointer key,
-                                       gpointer value,
-                                       gpointer user_data)
+gtk_action_muxer_append_group_actions (const char *prefix,
+                                       Group      *group,
+                                       GArray     *actions)
 {
-  const gchar *prefix = key;
-  Group *group = value;
-  GArray *actions = user_data;
   gchar **group_actions;
   gchar **action;
 
@@ -134,9 +131,13 @@ gtk_action_muxer_list_actions (GActionGroup *action_group)
 
   for ( ; muxer != NULL; muxer = muxer->parent)
     {
-      g_hash_table_foreach (muxer->groups,
-                            gtk_action_muxer_append_group_actions,
-                            actions);
+      GHashTableIter iter;
+      const char *prefix;
+      Group *group;
+
+      g_hash_table_iter_init (&iter, muxer->groups);
+      while (g_hash_table_iter_next (&iter, (gpointer *)&prefix, (gpointer *)&group))
+        gtk_action_muxer_append_group_actions (prefix, group, actions);
     }
 
   return (gchar **)(void *) g_array_free (actions, FALSE);